import java.util.concurrent.TimeUnit;

public class TestDaemonPriority {
    public static void main(String[] args) {
        Thread childThread = new Thread(() -> {
            int i = 1;
            while (true){
                System.out.println("l'm child thread"+(i++));
                try {
                    TimeUnit.MILLISECONDS.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        childThread.setDaemon(true);
        childThread.start();
        System.out.println("I'm main thread");
    }
}
